/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassandrawindow;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.avro.generic.GenericData;

/**
 *
 * @author MT844
 */
public class HandBlackList {
    
    public List getDomainBlackList () throws FileNotFoundException, IOException{
        List<String> domainBlackList = new ArrayList<>();
        //String path = "C:\\Users\\MT844\\Desktop\\blacklist\\blacklist_domain.txt";
        String path = "/home/bigdata/cpc/blacklist_domain.txt";
        BufferedReader br = new BufferedReader(new FileReader(path));
        
        try {
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();
            while (line != null) {
                domainBlackList.add(line);
                //sb.append("\n");
                line = br.readLine();
            }            
        } finally {
            br.close();
        }
        
        return domainBlackList;       
    }
    
    public List getZoneBlackList () throws FileNotFoundException, IOException{
        List<String> domainBlackList = new ArrayList<>();
        //String path = "C:\\Users\\MT844\\Desktop\\blacklist\\blacklist_zones.txt";
        String path = "/home/bigdata/cpc/blacklist_zones.txt";
        BufferedReader br = new BufferedReader(new FileReader(path));
        
        try {
            StringBuilder sb = new StringBuilder();
            String line = br.readLine();
            while (line != null) {
                domainBlackList.add(line);
                //sb.append("\n");
                line = br.readLine();
            }            
        } finally {
            br.close();
        }
        
        return domainBlackList;       
    }
        
}
